<?php
include ('genericos/translate.php');
include ('genericos/header.php');
include_once ('genericos/permisosURL.php');
if (isset($_SESSION['idioma'])) {
    $language = $_SESSION['idioma'];
}
?>
<title> EME | <?php echo _("consulta"); ?></title>
<!--
--><link type="text/css" href="css/redmond/jquery-ui-1.8.16.custom.css" rel="Stylesheet" />      
<script type="text/javascript" src="js/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.16.custom.min.js"></script>
<script language="JavaScript" type="text/javascript" src="js/ajax.js"></script>

<link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css"/>
<!--        <script src="js/jquery-1.6.min.js" type="text/javascript"></script>-->
<script src="js/jquery.validationEngine.js" type="text/javascript" charset="utf-8"> </script><!--

-->
<link type="text/css" href="js/jqgrid/css/ui.jqgrid.css" rel="stylesheet"/> 

<script type='text/javascript' src='js/utilitario.js'></script>

<?php
switch ($language) {
    case "es_ES":
        echo ' <script src="js/languages/jquery.validationEngine-es.js" type="text/javascript" charset="utf-8" ></script> ';
        echo ' <script src="js/jqgrid/i18n/grid.locale-es.js" type="text/javascript"></script> ';
        echo '<script src="js/languages/datetimepicker-es.js" type="text/javascript" charset="utf-8" ></script> ';
        echo '<script src="js/languages/timepicker-es.js" type="text/javascript" charset="utf-8" ></script> ';
        break;
    case "en_US":
        echo ' <script src="js/languages/jquery.validationEngine-en.js" type="text/javascript" charset="utf-8" ></script> ';
        echo ' <script src="js/jqgrid/i18n/grid.locale-en.js" type="text/javascript"></script>';

        break;
    case "pt_PT":
        echo ' <script src="js/languages/jquery.validationEngine-pt.js" type="text/javascript" charset="utf-8" ></script> ';
        echo ' <script src="js/jqgrid/i18n/grid.locale-pt.js" type="text/javascript"></script> ';
        echo '<script src="js/languages/datetimepicker-pt.js" type="text/javascript" charset="utf-8" ></script> ';
        break;
}
?>

<!--para los jqgrids-->



<script src="js/jqgrid/jquery.jqGrid.min.js" type="text/javascript"></script>
<!--timepicker-->


<script  language="JavaScript" src="js/jquery-ui-timepicker.js" type="text/javascript"></script>
<script type='text/javascript' src='js/jquery.autocomplete.js'></script>


<script  language="JavaScript" type="text/javascript">

    var j = jQuery.noConflict();

    var centromedico = 0;
    centromedico= leerCookie('idCentroMedico');
    var dscentromedico = "";
    dscentromedico= leerCookie('dsCentroMedico');
    var idconsulta = 0;
    var modoVista =1;
    var oper = "inicio";
        
    function cargarContenido(archivo,list){
        limpiarDiv('consulta');
        limpiarDiv('lista');

        var i = 1;
        j("#block_izq a").each(
        function(){
            j("#list"+i).removeClass("current_list");    
            j("#list"+i).css("color","#1D5987");
            i++;
        });
        j("#"+list).addClass("current_list");
        j("#"+list).css("color","#679EC9");
        
        
        
        
        j( "#mnsjexito" ).dialog({
            modal: true,
            autoOpen: false,
                
            buttons: {
                Ok: function() {
                    j( this ).dialog( "close" );
                }
            }
        });
            
            
        j( "#mnsjfallo" ).dialog({
            modal: true,
            autoOpen: false,
                
            buttons: {
                Ok: function() {
                    j( this ).dialog( "close" );
                }
            }
        });
        
        
        switch(archivo)
        {
        
            case "Consulta/consulta":
                
                var contenedor;
                contenedor = document.getElementById('consulta');
                ajax=objetoAjax();
                ajax.open("GET", archivo+".php",false);
                ajax.onreadystatechange=function() {
                    if (ajax.readyState==4) {
                        contenedor.innerHTML = ajax.responseText
                    }
                }
                ajax.send(null);
                
                j( "#archivosAdjuntos" ).accordion({
                    collapsible: true,
                    autoHeight: false
                });
                
                j( "#examFisico" ).accordion({
                    collapsible: true,
                    autoHeight: false
                });
                
                j( "#sintomas" ).accordion({
                    collapsible: true,
                    autoHeight: false
                });
        
                    cargarConsulta();
                break;
        
        
                case "Consulta/listaCitas":
              
                 var contenedor;
                contenedor = document.getElementById('lista');
                ajax=objetoAjax();
                ajax.open("GET", archivo+".php",false);
                ajax.onreadystatechange=function() {
                    if (ajax.readyState==4) {
                        contenedor.innerHTML = ajax.responseText
                    }
                }
                ajax.send(null);
                
                
                
                 j( "#listaCitas" ).accordion({
                    collapsible: true,
                    autoHeight: false
                });
              
              
              break;
        
        
        
        
        }
    }
    
    function cargarConsulta(){
        registrarDatosConsulta();
    
    }
    
    function registrarDatosConsulta()
    {
        var url = "classConsulta.php";
        var datos = url+ "?accion=registro";
        
        var consulta = consultaTexto(datos);

        if(trim(consulta) == ""){
            
            alert("todo bien");
        }else{
            alert("casi  bien");
            
        }
        
         
       
      
       
    }
    
   
    window.onload= function(){
        cargarContenido("Consulta/listaCitas","list1");
    }
    
    
</script>
</head>


<body>



    <div id="wrapper">

        <script type="text/javascript">
            var s = jQuery.noConflict();
     
            s(document).ready(function() {
                s(".topMenuAction").click( function() {
                    if (s("#openCloseIdentifier").is(":hidden")) {
                        s("#slider").animate({ 
                            marginTop: "-50px"
                        }, 500 );
                        s("#topMenuImage").html('<?php echo $_SESSION['Nombre']; ?>');
                        s("#openCloseIdentifier").show();
                    } else {
                        s("#slider").animate({ 
                            marginTop: "0px"
                        }, 500 );
                        s("#topMenuImage").html('<?php echo $_SESSION['Nombre']; ?>');
                        s("#openCloseIdentifier").hide();
                    }
                });  
            });
        </script>



        <div id="head">

            <div id="logo">

            </div>

            <div id="logout">
                <!--<a href="#" title="Mi Cuenta" alt="Mi Cuenta">Cuenta</a>-->
                <?php include ('genericos/html_logout.php'); ?>

            </div>

        </div> <!-- head -->
        <div id="Menu_principal">
            <?php include ('genericos/Menu_principal.php'); ?>
        </div> <!-- block1 -->

        <div id="block_izq">

            <ul>
                <li><a id="list1" onclick="javascript:cargarContenido('Consulta/listaCitas',this.id)"><?= _("citasHoy") ?> </a></li>
                <li><a id="list2" onclick="javascript:cargarContenido('Consulta/consulta',this.id)"><?= _("consulta") ?> </a></li>

            </ul>



        </div> <!-- block3 -->



        <div id="block_der">


            <div id="consulta"></div>
            <div id="lista"></div>

        </div> <!-- block4 -->
        <div id="footer">
            <?php include ('genericos/footer.php'); ?>
        </div> <!-- block5 -->

    </div> <!-- wrapper -->

    <div id="mnsjexito" title="<?= _("mensajeexito") ?>">
        <p>
            <?= _("exito") ?>
        </p>

    </div>

    <div id="mnsjfallo" title="<?= _("mensajefallo") ?>">
        <p>
            <?= _("fallo") ?>
        </p>

    </div>



</body>
</html>

